<?php
class PromotionJoin extends Eloquent {
	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'promotion_joins';
	protected $fillable = array('promotion_id', 'ctreator_id', 'category_id', 'contact_name', 'contact', 'email', 'company_name', 'up_file', 'is_urgent');

	/**
	 * 模型对象关系：店铺
	 * @return object Store
	 */
	public function promotion()
	{
		return $this->belongsTo('Promotion', 'promotion_id', 'id');
	}

	public static function createJoin($data)
	{
		 $promotion_join = new PromotionJoin($data);
         $promotion_join->creator_id = Auth::check() ? Auth::user()->id : 0;
		 return $promotion_join;	
	}

}
